home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.10
/
demo
/
vdx.i
/
pic.i
next >
Wrap
Text File
|
1995-04-19
|
2KB
|
79 lines
{ Pic.i 4 sparky }
{$I "Include:graphics/gfxbase.i" }
{$I "Include:intuition/screens.i" }
{$I "Include:Utils/stringlib.i" }
{$I "Include:libraries/iff.i" }
Function ShowPix( arg : String ): String;
Const
ns : NewScreen = (0,0,0,0,0,0,0,0,CUSTOMSCREEN_f+SCREENQUIET_f,
NIL, NIL, NIL, NIL);
Var
MyIff : IffFile;
count : Integer;
colortable : Array[1..128] of Short;
bmhd : BitMapHeaderPtr;
myscreen : ScreenPtr;
Procedure ClearShowPix;
Begin
if myscreen <> NIL then CloseScreen( myscreen );
if MyIff<>NIL then CloseIFF(MyIff);
End;
{ -- Hauptprogramm -- }
BEGIN
myscreen := NIL;
{ -- IFF-Pic laden -- }
MyIff:=OpenIFF(arg);
if MyIff=NIL then begin
ClearShowPix;
ShowPix := "Unable 2 load pic";
end;
{ -- Bitmap-Header holen -- }
bmhd := GetBMHD(MyIff);
if bmhd = NIL then begin
ClearShowPix;
ShowPix := "BitMapHeader not found";
end;
ns.Width := bmhd^.w; { -- Infos zum Pic -- }
ns.Height := bmhd^.h; { -- holen, für -- }
ns.Depth := bmhd^.nPlanes; { -- den Screen -- }
ns.ViewModes := GetViewModes(MyIff);
{ -- Screen öffnen -- }
myscreen := OpenScreen(Adr(ns));
if myscreen = NIL then begin
ClearShowPix;
ShowPix := "Can't open screen 4 pic!";
end;
{ -- Farben setzen -- }
count := GetColorTab(MyIff,Adr(colortable));
if (count>32) then count:=32;
{ -- HAM/Halfbrite-Pictures haben 64++ Farben -- }
LoadRGB4(Adr(myscreen^.SViewPort),Adr(colortable),count);
{ -- Pic ggf. decodieren und in den Screen kopieren -- }
if NOT DecodePic(MyIff,Adr(myscreen^.SBitMap)) then
if myscreen<>NIL then begin
ClearShowPix;
ShowPix := "Can't decode picture";
end;
Delay(300); { -- 4 Secs warten -- }
ClearShowPix; { -- Prc. sauber verlassen -- }
ShowPix := "Yeah !";
End;